﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace DynamicListView
{
    public class MainWindowViewModel
    {
        /// <summary>
        /// 绑定的数据
        /// </summary>
        public ObservableCollection<DynamicListViewTest> Data { get; set; } =
            new ObservableCollection<DynamicListViewTest>();

        public MainWindowViewModel()
        {
            Data.Add(new DynamicListViewTest()
            {
                Time = DateTime.Now,
                DynamicData = new List<double>{1,2,3}
            });
        }
    }

    public class DynamicListViewTest
    {
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime Time { get; set; }
        /// <summary>
        /// 不固定的数据
        /// </summary>
        public List<double> DynamicData { get; set; } = new List<double>();
    }
}